﻿Imports System.Data.SqlClient
Public Class members_purchaseedit
    Inherits System.Web.UI.Page
    Private sSQL As String
    Private objrd As SqlDataReader = Nothing
    Private objfind As New GetData
    Private ps As New PreparedStatement(sSQL)
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (Session("uid") <> Nothing And Session("uid") <> "") Then
            Dim editType, purchaseId, strErr As String
            editType = Request("editType")
            purchaseId = Request("purchaseId")
            strErr = ""
            If (editType.Equals("delete")) Then
                ps.strSql = "delete from purchase where id = @id"
                ps.parameters.Clear()
                ps.addParameter("id", purchaseId)
                objfind.es(ps, strErr)
                If (strErr = "") Then
                    MsgBox("删除成功！")
                    Response.Redirect("members-purchaseManagement.aspx")
                End If
            End If
        Else
            Response.Redirect("../cn_login.aspx")
        End If
    End Sub

End Class